<div class="main" style="background-color: white;">
	<div class="easyui-panel" style="border-style: none;">
		<form id="editForm" method="post" class="validate" enctype="multipart/form-data" >
			<table>
				<tr>
					<th>分类名称</th>
					<td>
						<input class="input_text easyui-validatebox" type="text" id="name" value="${cat.name}" name="name"  maxlength="60" data-options="required:true"></input>
					</td>
				</tr>
				<tr>
					<th>分类图片</th>
					<td>
						<input class="easyui-validatebox" type="file" id="image"  style="width:300px" name="file"></input>
						<input type="hidden" value="${cat.image!''}" name="image">
					</td>
				</tr>
				<#if imgPath??>
					<tr>
						<th></th>
						<td><img alt="" src="${imgPath!''}" style="width:300px">
						</td>
					</tr>
				</#if>
				<#assign x=cat.parent_id>
				<tr>
					<th>是否为顶级分类</th>
					<td><input type="radio" name="cattype" class="cattype"
						value="0"<#if x!=0>checked</#if> >否
						&nbsp;&nbsp;&nbsp;&nbsp; 
						<input type="radio" name="cattype"
						class="cattype" value="1"<#if x==0>checked</#if> >是</td>
				</tr>
				<tr class="addtr"
					<#if x==0>style="display: none;"</#if>>
					<th>上级分类</th>
						<td>
							 <#if "${cat.parent_id!''}" == "0">  	
							<input class="easyui-combotree combo" value="无" name="parent_id" data-options="url:'${ctx}/shop/admin/cat/add-list-json.do',method:'get',required:true,height:28" style="width: 200px;">
							<#else>
							<input class="easyui-combotree combo" value="${cat.parent_id!''}" name="parent_id" data-options="url:'${ctx}/shop/admin/cat/add-list-json.do',method:'get',required:true,height:28" style="width: 200px;">
							 </#if> 
						</td>
					</tr>
				<tr>
					<th>商品类型</th>
					<td>
						<input class="easyui-combotree combo" value="${cat.type_id!''}" name="type_id" data-options="url:'${ctx}/shop/admin/cat/type-list-json.do',method:'get',required:true,height:28" style="width: 200px;">
					</td>
				</tr>
				<tr>
					<th>排序</th>
					<td><input class="input_text easyui-numberbox" type="text" id="order" value="${cat.cat_order}" name="cat_order"
							maxlength="5" data-options="required:true"></input>
					</td>
				</tr>
				<tr>
					<input type="hidden" name="list_show" value="1" checked="checked" />
					<!-- <th>列表中显示</th>
					<td><input type="radio" class="listshow"  name="list_show" value="1" />是&nbsp; 
						<input type="radio" class="listshow"  name="list_show" value="0" />否</td> -->
				</tr>
			</table>
			<input type="hidden" name="cat_id" value="${cat.cat_id}">
		</form>
	</div>
</div>

<script>
	$(function() {
		$(".cattype").click(function() {
			if ($(this).val() == 1) {
				$(".addtr").hide();
			}
			if ($(this).val() == 0) {
				$(".addtr").show();
			}
		})
		$(".listshow").each(function(){
			if($(this).val() ==  '${cat.list_show!''}' ){
				$(this).attr("checked",true);
			}
		});
	});
</script>